﻿'use strict';
(function () {
    // 注意JS的绑定顺序，第一组绑定的文件可以用angular.module('MyControllers', []);，后续的文件只能用angular.module('MyControllers')
    var service = angular.module('MyServices');

    service.factory('examSiteService', ['$http', function (http) {
        var methods = {
            // 获取当前主办方及考点信息
            getInfo: function () {
                return http.post('/ExamSite/GetInfo/');
            },
            // 修改密码
            changePwd: function (oldPwd, newPwd) {
                return http.post('/ExamSite/ChangePwd/', { oldPwd: oldPwd, newPwd: newPwd });
            },
            // 修改服务器URL
            changeUrl: function (appId, appUrl, ftpUrl) {
                return http.post('/ExamSite/ChangeUrl/', { appId: appId, appUrl: appUrl, ftpUrl: ftpUrl });
            },
            // 修改当前主办方
            changeCurApp: function (appId) {
                return http.post('/ExamSite/ChangeCurApp/', { appId: appId });
            }
        };
        return methods;
    }]);
})();